
using namespace std;
#include"HashTable.h"

void test1()
{
	hash_table::HashTable<int, int> hs;
	hs.Insert(make_pair(1, 1));
	hs.Insert(make_pair(7, 1));
	hs.Insert(make_pair(23, 1));
	hs.Insert(make_pair(12, 1));
	hs.Insert(make_pair(16, 1));
	hs.Insert(make_pair(8, 1));
	hs.Insert(make_pair(10, 1));
	hs.Insert(make_pair(19, 1));
	hs.Print();
	cout << hs.Find(9) << " " << hs.Find(7) << endl;
	
	hs.Erase(23);
	hs.Print();

}
void test2()
{
	hash_table::HashTable<string, int> hs;
	hs.Insert(make_pair("hh", 1));
	hs.Insert(make_pair("haha", 1));
	hs.Insert(make_pair("123", 1));
	hs.Insert(make_pair("234", 1));
	hs.Insert(make_pair("23456", 1));
	hs.Insert(make_pair("sort", 1));
	hs.Insert(make_pair("string", 1));
	hs.Insert(make_pair("hashtable", 1));
	hs.Print();
	cout << hs.Find("hh") << " " << hs.Find("hahaa") << endl;

	hs.Erase("hh");
	hs.Print();

	cout << hs.Size() << endl;
	cout << hs.Empty() << endl;

	hash_table::HashTable<string, int> hs2;
	hs2.Insert(make_pair( "reserve",100 ));
	hs2.Insert({ "reverse",200 });

	hs.Swap(hs2);
	hs.Print();

}
int main()
{
	test2();
	return 0;
}